//express_demo.js 文件
var express = require('express');
var app = express();
//全局解析
const bodyParser = require('body-parser');
app.use(bodyParser.json());


app.get('/', function (req, res) {
    res.send('Hello World');
})

var server = app.listen(8082, function () {

    var host = server.address().address
    var port = server.address().port

    console.log("应用实例，访问地址为 http://%s:%s", host, port)

})

const path = require('path')
const process = require("process");
app.use('/', express.static(path.join(__dirname, 'static')))
process.on('uncaughtException', function (err) {
    console.log('Caught exception: ' + err);
});

const routers = require("./router/index");
routers(app)

// 注解框架：https://blog.csdn.net/palerock/article/details/108491555

